package com.osell.selection.ui.main;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.osell.selection.data.network.entity.Product;

import java.util.List;

public class RecommendProductPagerAdapter extends FragmentStatePagerAdapter {

    private List<Product> mData;

    RecommendProductPagerAdapter(FragmentManager fm, List<Product> data) {
        super(fm);
        this.mData = data;
    }

    @Override
    public Fragment getItem(int position) {
        return RecommendProductFragment.newInstance(mData.get(position));
    }

    @Override
    public int getCount() {
        return mData == null ? 0 : mData.size();
    }
}
